package com.example.administrator.yuejian35.Find;

import com.example.administrator.yuejian35.Find.bean.Comment;
import com.example.administrator.yuejian35.Find.bean.Post;
import com.example.administrator.yuejian35.Find.bean.PostPic;
import com.example.administrator.yuejian35.Home.bean.Result;
import com.example.administrator.yuejian35.Recommend.bean.Cancleguanzhu;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Query;

import static android.R.attr.description;

/**
 * Created by HP on 2017/9/17.
 */

public interface FindServer {

    //编写接口
    @GET("Post/getAllPost") //帖子列表
    Call<List<Post>> postlist();

    @GET("Post/getPostByUser") //帖子列表
    Call<List<Post>> getPostByUser(@Query("uid") String uid);

    @GET("Post/deletepost") //删除帖子列表
    Call<Cancleguanzhu> deletepost(@Query("pid") String pid);

    @GET("Post/getPostPic") //帖子详情
    Call<List<PostPic>> postpic(
            @Query("pid") int pid
    );

    @GET("Post/getComment") //评论列表
    Call<List<Comment>> commentlist(
            @Query("pid") int pid
    );


    @Multipart
    @POST("Post/addPost")//添加帖子
     Call<Result> addpost(
            @Query("uid") int uid,
            @Query("content") String content,
            @Part MultipartBody.Part file
    );

    @Multipart
    @POST("Post/addPost")//添加帖子
    Call<Result> addmore(
            @Query("uid") String uid,
            @Query("content") String content,
            @PartMap Map<String,RequestBody> file
            );

    @GET("Post/collectpost") //收藏post
    Call<Result> post_collect(
            @Query("pid") String pid,
            @Query("uid") String uid,
            @Query("type") String type,
            @Query("id") String id
    );

    @GET("Post/comhits") //点赞帖子
    Call<Result>  comment_hit(
            @Query("pcid") String pcid,
            @Query("type") String type
    );

    @GET("Post/addcomment") //添加评论
    Call<Result> comment(
            @Query("pid") String pid,
            @Query("uid") String uid,
            @Query("content") String content

    );


}
